import Layout from '@/layout/index.vue'
import { createNameComponent } from '../createNode'
const route = [
  // 商品管理
  {
    path: '/product',
    component: Layout,
    redirect: '/product/shopManagement',
    meta: { title: '商品管理', icon: 'el-icon-goods' },
    alwayShow: true,
    children: [
      {
        path: 'commodityManagement',
        component: createNameComponent(() => import('@/views/product/commodityManagement.vue')),
        meta: { title: '商品管理'},
      },
      {
        path: 'shopManagement',
        component: createNameComponent(() => import('@/views/product/shopManagement.vue')),
        meta: { title: '小店管理'},
      },
     
      {
        path: 'Write-offPoint',
        component: createNameComponent(() => import('@/views/product/Write-offPoint.vue')),
        meta: { title: '核销点管理'},
      },
      {
        path: 'shopManagement',
        component: createNameComponent(() => import('@/views/product/shopManagement.vue')),
        meta: { title: '类目管理'},
      },
      {
        path: 'category',
        component: createNameComponent(() => import('@/views/product/category.vue')),
        meta: { title: '活动管理'},
      },
      {
        path: 'SKU',
        component: createNameComponent(() => import('@/views/product/SKU.vue')),
        meta: { title: 'SKU管理'},
      },
      {
        path: 'banner',
        component: createNameComponent(() => import('@/views/product/banner.vue')),
        meta: { title: 'banner管理'},
      },
    ]
  },
  // 团队管理
  {
    path: '/pages',
    component: Layout,
    redirect: '/pages/serviceProvider',
    meta: { title: '团队管理', icon: 'el-icon-document-copy' },
    alwayShow: true,
    children: [
      {
        path: 'serviceProvider',
        component: createNameComponent(() => import('@/views/main/pages/serviceProvider/index.vue')),
        meta: { title: '服务商管理', cache: false, roles: ['editor']},
      },
      {
        path: 'categoryTable',
        component: createNameComponent(() => import('@/views/main/pages/regCommander/index.vue')),
        meta: { title: '团长管理', cache: true, roles: ['admin'] },
      },
      {
        path: 'treeTable',
        component: createNameComponent(() => import('@/views/main/pages/helpSell/index.vue')),
        meta: { title: '帮卖团长管理', cache: true, roles: ['editor'] }
      }
    ]
  },
  // 用户管理
  {
    path: '/user',
    component: Layout,
    redirect: '/user/user',
    meta: { title: '用户管理', icon: 'el-icon-user' },
    alwayShow: true,
    children: [
      {
        path: 'user',
        component: createNameComponent(() => import('@/views/user/user.vue')),
        meta: { title: '用户管理'},
      }
    ]
  },
  // 提现管理
  {
    path: '/withdraw',
    component: Layout,
    redirect: '/withdraw/withdraw',
    meta: { title: '提现管理', icon: 'el-icon-collection' },
    alwayShow: true,
    children: [
      {
        path: 'withdraw',
        component: createNameComponent(() => import('@/views/withdraw/withdraw.vue')),
        meta: { title: '提现管理'},
      }
    ]
  },
  // 订单管理
  {
    path: '/order-forGoods',
    component: Layout,
    redirect: '/order-forGoods/order-forGoods',
    meta: { title: '订单管理', icon: 'el-icon-document' },
    alwayShow: true,
    children: [
      {
        path: 'order-forGoods',
        component: createNameComponent(() => import('@/views/order-forGoods/order-forGoods.vue')),
        meta: { title: '订单管理'},
      }
    ]
  },
  // 审核管理
  {
    path: '/examine',
    component: Layout,
    redirect: '/examine/examine',
    meta: { title: '审核管理', icon: 'el-icon-check' },
    alwayShow: true,
    children: [
      {
        path: 'examine',
        component: createNameComponent(() => import('@/views/examine/examine.vue')),
        meta: { title: '审核管理'},
      }
    ]
  },
  // 服务广场
  {
    path: '/servicePlaza',
    component: Layout,
    redirect: '/servicePlaza/servicePlaza',
    meta: { title: '服务广场', icon: 'el-icon-phone-outline' },
    alwayShow: true,
    children: [
      {
        path: 'servicePlaza',
        component: createNameComponent(() => import('@/views/servicePlaza/servicePlaza.vue')),
        meta: { title: '服务广场'},
      }
    ]
  },
  // 反馈管理
  {
    path: '/feedback',
    component: Layout,
    redirect: '/feedback/feedback',
    meta: { title: '反馈管理', icon: 'el-icon-bell' },
    alwayShow: true,
    children: [
      {
        path: 'feedback',
        component: createNameComponent(() => import('@/views/feedback/feedback.vue')),
        meta: { title: '反馈管理'},
      }
    ]
  },
  // 角色管理
  {
    path: '/role',
    component: Layout,
    redirect: '/role/role',
    meta: { title: '角色管理', icon: 'el-icon-set-up' },
    alwayShow: true,
    children: [
      {
        path: 'role',
        component: createNameComponent(() => import('@/views/role/role.vue')),
        meta: { title: '角色管理'},
      }
    ]
  },
  // 账号管理
  {
    path: '/accountNumber',
    component: Layout,
    redirect: '/accountNumber/accountNumber',
    meta: { title: '账号管理', icon: 'el-icon-chat-square' },
    alwayShow: true,
    children: [
      {
        path: 'accountNumber',
        component: createNameComponent(() => import('@/views/accountNumber/accountNumber.vue')),
        meta: { title: '账号管理'},
      }
    ]
  },
  // 通用设置
  {
    path: '/generalSetting',
    component: Layout,
    redirect: '/generalSetting/generalSetting',
    meta: { title: '通用设置', icon: 'el-icon-magic-stick' },
    alwayShow: true,
    children: [
      {
        path: 'generalSetting',
        component: createNameComponent(() => import('@/views/generalSetting/generalSetting.vue')),
        meta: { title: '通用设置'},
      }
    ]
  },
]

export default route